package com.mezz.bones.im.common.service.impl;

import com.mezz.bones.im.common.domain.dto.ApplicationDto;
import com.mezz.bones.im.common.service.IApplicationService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @Author: zhuang
 * @Date: 2025/5/9 14:06
 * @Description: TODO
 * @Version: 1.0
 **/

@Service
public class ApplicationServiceImpl implements IApplicationService {

    @Value("${spring.profiles.active}")
    private String env;
    @Override
    public ApplicationDto getByAppId() {

        ApplicationDto dto = new ApplicationDto();

        if("prod".equals(env)){
            dto.setAppId("prod-134595222021");
            dto.setAppSecret("prod-0d427b5c01d438e9a1666e72345316ab752ac409567dde941b297fa264453314182");
        }else {
            dto.setAppId("dev-134595222021");
            dto.setAppSecret("dev-0d427b5c01d438e9a1666e72345316ab752ac409567dde941b297fa264453314182");
        }

        switch (env) {
            case "dev":
                dto.setNotifyUrl("172.10.0.155:18085/no-auth/im/callback");
                break;
            case "test":
            case "pre-test":
                dto.setNotifyUrl("");
                break;
            case "prod":
                break;
            case "temp":
            default:
                dto.setNotifyUrl("");
                break;
        }
        return dto;
    }
}
